package rgbos.forum.search;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Vector;

import rgbos.forum.domain.Post;

public class SearchEngine implements AbstractSearchEngine {
	private AbstractSearchEngine engine_;

	public SearchEngine() {
		engine_ = new CompassSearchEngine();
	}

	@Override
	public Vector<PostRate> searchByAuthor(String name) {
		return engine_.searchByAuthor(name);
	}

	@Override
	public Vector<PostRate> searchByContent(String searchQuery) {
		return engine_.searchByContent(searchQuery);
	}

	@Override
	public Vector<PostRate> searchByDate(String date) {
		return engine_.searchByDate(date);
	}

	public Vector<PostRate> searchByDate(String from,String to) {
		return engine_.searchByDate(from, to);
	}

	@Override
	public void indexPost(Post message) {
		engine_.indexPost(message);
	}

	@Override
	public void deletePost(Post message) {
		engine_.deletePost(message);
	}

	@Override
	public void modifyPost(Post oldMessage, Post newMessage) {
		engine_.modifyPost(oldMessage,newMessage);
	}
}
